<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
                "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
  <title>Description of rotationMatrix</title>
  <meta name="keywords" content="rotationMatrix">
  <meta name="description" content="Performs different operations dealing with a rotation matrix">
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  <meta name="generator" content="m2html &copy; 2003 Guillaume Flandin">
  <meta name="robots" content="index, follow">
  <link type="text/css" rel="stylesheet" href="../m2html.css">
</head>
<body>
<a name="_top"></a>
<!-- menu.html matlab -->
<h1>rotationMatrix
</h1>

<h2><a name="_name"></a>PURPOSE <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>Performs different operations dealing with a rotation matrix</strong></div>

<h2><a name="_synopsis"></a>SYNOPSIS <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="box"><strong>function varargout=rotationMatrix(varargin) </strong></div>

<h2><a name="_description"></a>DESCRIPTION <a href="#_top"><img alt="^" border="0" src="../up.png"></a></h2>
<div class="fragment"><pre class="comment"> Performs different operations dealing with a rotation matrix

 USAGE
  R = rotationMatrix( M )
  [u,theta] = rotationMatrix( R )
  R = rotationMatrix( theta )
  R = rotationMatrix( u )
  R = rotationMatrix( u, theta )
  R = rotationMatrix( th1, th2, th3 )
  R = rotationMatrix( R2 )

 INPUTS 1 - Finds the closest rotation matrix to a given matrix M
  M       - 3x3 matrix

 INPUTS 2 - Extract the axis and the angle of a 3x3 rotation matrix
  R       - 3x3 Rotation matrix

 INPUTS 3 - Creates a 2x2 rotation matrix from an angle
  theta   - angle of rotation (radians)

 INPUTS 4 - Creates a 3x3 rotation matrix from a rotation vector
  u       - 1x3 or 3x1 axis of rotation - norm is theta

 INPUTS 5 - Creates a 3x3 rotation matrix from a rotation vector
  u       - axis of rotation
  theta   - angle of rotation (radians)

 INPUTS 6 - Creates a 3x3 rotation matrix from 3 angles (around fixed
            axes)
  th1     - angle with respect to X axis
  th2     - angle with respect to Y axis
  th3     - angle with respect to Z axis
      such that R = Rx*Ry*Rz

 INPUTS 7 - Creates the full 3x3 rotation matrix from its first 2 rows
  R       - 2x3 first two rows of the rotation matrix

 INPUTS 8 - Extract the 3 angles of a 3x3 rotation matrix
  R       - 3x3 Rotation matrix

 OUTPUTS 1,4,5,6,7
  R       - 3x3 rotation matrix

 OUTPUTS 2
  u       - axis of rotation
  theta   - angle of rotation (radians)

 OUTPUTS 3
  R       - 2x2 Rotation matrix

 OUTPUTS 8
  th1     - angle with respect to X axis
  th2     - angle with respect to Y axis
  th3     - angle with respect to Z axis
     such that R = Rx*Ry*Rz

 EXAMPLE 1
  R3 = rotationMatrix( [0 0 1], pi/4 )+rand(3)/50
  R3r = rotationMatrix( R3 )
  [u,theta]  = rotationMatrix( R3r )

 EXAMPLE 2
  R3 = rotationMatrix( [0 0 1], pi/4 );
  [u,theta]  = rotationMatrix( R3 )

 EXAMPLE 3
  R2 = rotationMatrix( pi/4 )

 EXAMPLE 4
  R3 = rotationMatrix( [0 0 .5] )

 EXAMPLE 5
  R3 = rotationMatrix( [0 0 1], pi/4 )

 EXAMPLE 6
  R3 = rotationMatrix( pi/4,pi/4,0 )

 EXAMPLE 7
  R3 = rotationMatrix( pi/4,pi/4,0 )
  R3bis = rotationMatrix( R3(1:2,:) )

 EXAMPLE 7
  [th1 th2 th3] = rotationmatrix( rotationMatrix( pi/4,pi/4,0 ) );

 EXAMPLE 8
  [th1 th2 th3]=rotationMatrix(rotationMatrix(1,2,3))

 See also

 Piotr's Computer Vision Matlab Toolbox      Version 2.35
 Copyright 2014 Piotr Dollar.  [pdollar-at-gmail.com]
 Licensed under the Simplified BSD License [see external/bsd.txt]</pre></div>





<!-- Start of Google Analytics Code -->
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
</script>
<script type="text/javascript">
var pageTracker = _gat._getTracker("UA-4884268-1");
pageTracker._initData();
pageTracker._trackPageview();
</script>
<!-- end of Google Analytics Code -->

<hr><address>Generated by <strong><a href="http://www.artefact.tk/software/matlab/m2html/" target="_parent">m2html</a></strong> &copy; 2003</address>
</body>
</html>
